package com.ostrich.demobrvah

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.ostrich.demobrvah.adapter.DemoAdapter
import com.ostrich.demobrvah.entity.*

class MainActivity : AppCompatActivity() {
    private lateinit var rv:RecyclerView
    private lateinit var demoAdapter: DemoAdapter
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        rv = findViewById(R.id.rv)
        demoAdapter = DemoAdapter()
        rv.adapter = demoAdapter
        rv.layoutManager = LinearLayoutManager(this)
        //数据源
        val list = mutableListOf<BaseEntity>()
        list+=OneEntity("111")
        list+=TwoEntity("66")
        list+=OneEntity("55")
        list+=OneEntity("111")
        list+=ThreeEntity("444")
        list+= AA("444")
        demoAdapter.setList(list)


    }
}